﻿using NFine.Code;
using NFine.Data;
using NFine.Domain.Entity.Biz;
using NFine.Domain._02_ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NFine.Domain._04_IRepository.Biz
{
    public interface IUserOrderRepository : IRepositoryBase<UserOrderEntity>
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="Id"></param>
        int updateOrderStatus(string Id, int orderStatus);
        

        int UpdateBackMoneyStatus(string id, int backMoneyStatus);

        int CurMonthOrderCount();

        decimal? CurMonthMoneyCount();

        decimal? AllMoneyCount();

        /// <summary>
        /// 获取数据最大时间
        /// </summary>
        /// <returns></returns>
        DateTime getMaxTime();

        /// <summary>
        /// 获取数据最小时间
        /// </summary>
        /// <returns></returns>
        DateTime getMinTime();

        /// <summary>
        /// 年消费总额
        /// </summary>
        /// <param name="year"></param>
        /// <returns></returns>
        decimal getSumMoneyByYear(string year);

        /// <summary>
        /// 今日消费总额
        /// </summary>
        /// <returns></returns>
        decimal getSumMoneyByNow();
        /// <summary>
        /// 创建订单
        /// </summary>
        /// <param name="parentOrder"></param>
        /// <param name="list_OrderItems"></param>
        /// <returns></returns>
        int SubmitOrder(UserOrderEntity parentOrder, List<OrderItemEntity> list_OrderItems, OrderActionEntity actionEntity);

        decimal SumUserConsumeByMonth(string userId, DateTime date);

        int UpdateBalanceByMonth(DateTime date);

        decimal SumAllOrderByMonth(DateTime date);

        /// <summary>
        /// 自动作废3小前的未支付订单
        /// </summary>
        /// <returns></returns>
        int orderZF_Auto();

        /// <summary>
        /// 自动完成十天前的订单
        /// </summary>
        /// <returns></returns>
        int orderWC_Auto();
    }
}
